import { RouteRecordRaw } from "vue-router";
import Layout from "/@/layout/Layout.vue";

/**
 * 对应路由的头部组件信息
 */
interface RouteMetaHeader {
  title?: string; // 头部title,
  back?: boolean; // 返回按钮
  close?: boolean; // 返回按钮
  notice?: boolean; // 消息组件
}

declare module "vue-router" {
  interface RouteMeta {
    header?: RouteMetaHeader | false;
    navbar?: boolean;
  }
}
export const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "Layout",
    component: Layout,
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "HomeIndex",
        component: () => import("/@/views/home/HomeIndex.vue"),
        meta: {
          header: {
            title: "首页",
            back: true,
            notice: true,
          },
          navbar: true,
        },
      },
      {
        path: "/income",
        name: "IncomeIndex",
        component: () => import("/@/views/income/IncomeIndex.vue"),
        meta: {
          header: false,
          navbar: true,
        },
      },
      {
        path: "/mine",
        name: "MineIndex",
        component: () => import("/@/views/mine/MineIndex.vue"),
        meta: {
          navbar: false,
        },
      },
    ],
  },
];
